<?php

namespace App\Api\Controllers;

class Controller {

    public function success($data=[], $code=200)
    {
        return response()->json([
            'code' => $code,
            'success' => true,
            'data' => $data,
        ]);
    }

    public function error($message, $code=400)
    {
        return response()->json([
            'code' => $code,
            'success' => false,
            'message' => $message
        ]);
    }
}
